// ml:run = $bin < input
#include <iostream>
#include <set>
#include <algorithm>
#include <string>

int const maxn = 100007;
int st[maxn][30];
bool vis[maxn];
int log2[maxn];

std::string s;
int m;
int n;

bool cmp(char a, char b)
{
    return a < b;
}

int log22(int len)
{
    int tmp = 0;
    for (; int(1 << tmp) <= len; tmp++); // FIXME 11 neednot write int
    return tmp - 1;
}

void init()
{
    for (int i = 0; i < maxn; i++)
        log2[i] = log22(i);

    int n = s.size();
    int len = log2[n];
    for (int i = 0; i < n; i++) st[i][0] = i;
    for (int l = 1; l <= len; l++)
        for (int i = 0; (i + (1<<l) - 1) < n; i++)
            if (cmp(s[ st[i][l - 1] ], s[ st[i + (1<<(l-1))][l - 1] ]))
                st[i][l] = st[i][l - 1];
            else
                st[i][l] = st[i + (1 << (l-1))][l - 1];
}

// [l, r]
int query_interval_index(int l, int r)
{
    int k = log2[r - l + 1];
    if (cmp(s[ st[l][k] ], s[ st[r - (1<<k) + 1][k] ]))
        return st[l][k];
    else
        return st[r - (1<<k) + 1][k];
}

// [l, r]
int query_interval(int l, int r)
{
    return s[ query_interval_index(l, r) ];
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin >> m >> s;
    n = s.size();
    init();
    std::string ans;
    std::set<char> all;
    for (int l = 0; l < n - m + 1; ) {
        int r = l + m - 1;
        int p = query_interval_index(l, r);
        ans += s[p];
        all.insert(s[p]);
        vis[p] = true;
        l = p + 1;
    }
    if (all.size() > 0) {
        char ch = *(std::prev(all.end()));
        for (int i = 0; i < n; i++) {
            if (vis[i]) continue;
            if (s[i] < ch) {
                ans += s[i];
            }
        }
    }
    std::sort(ans.begin(), ans.end());
    std::cout << ans << "\n";
}

